//
//    Rewrite of the CUDA sample 'postProcess' using both CUDA
//    and GLSL Compute Shader.
//

#include "CudaGLComputeApp.hpp"


int main(int argc, char *argv[])
{
  CudaGLComputeApp app;
  
  aer::Window *win = app.createWindow( 
      aer::Display( CudaGLComputeApp::kSize, CudaGLComputeApp::kSize, 24, 0, 4, 2), 
      "Cuda-GL Compute" );
  win->setVerticalSync( true );


  std::cout << 
  "This demo shows GLSL 4.2 Compute Shader capabilities. A 16*16 blur filter is apply\
to a real-time scene as a post-process stage. A CUDA kernel is also available to\
compare performances."  << std::endl
  << std::endl
  << "[+/-] : change kernel radius."              << std::endl
  << "[T] : display GPU kernel execution time."   << std::endl
  << "[SPACE] : toggle CUDA or GLSL kernel."      << std::endl
  << "[W-A-S-D + mouse] : control the camera."    << std::endl
  << "[ESCAPE] : quit the application."           << std::endl
  << std::endl;
  

  app.run();  
    
  return EXIT_SUCCESS;
}

